<?php

namespace app\common\model;

use think\model\concern\SoftDelete;

class Site extends \think\Model
{
    use SoftDelete;

    protected $table = 'db_site';

    protected $jsonAssoc = true;

    protected $autoWriteTimestamp = true;

    protected $schema = [
        'id' => 'int',
        'create_time' => 'int',
        'update_time' => 'int',
        'delete_time' => 'int',
        'pubid' => 'varchar',
        'sort' => 'int',
        'name' => 'varchar',
        'member_id' => 'int',
        'communication_status' => 'varchar',
        'website' => 'varchar',
        'today_quantity' => 'int',
        'yesterday_quantity' => 'int',
        'cumulative_quantity' => 'int',
        'column_interface' => 'varchar',
        'publishing_interface' => 'varchar',
        'headers' => 'varchar',
        'cookies' => 'varchar',
        'title_field' => 'varchar',
        'column_field' => 'varchar',
        'thumbnail_field' => 'varchar',
        'create_time_field' => 'varchar',
        'article_content_field' => 'varchar',
        'other_fields' => 'text',
        'publish_success_flag' => 'varchar',
        'is_https' => 'tinyint',
        'secret_key' => 'varchar',
        'site_demo_id' => 'int',
        'tags_field' => 'varchar',
        'keywords_field' => 'varchar',
        'description_length' => 'int',
        'description_field' => 'varchar',
        'keywords_library' => 'text',
    ];

    public $getters = [
        
    ];

    /**
     * 关联模型pushPlan
     */
    public function pushPlan()
    {
        return $this->hasMany(PushPlan::class );
    }

    /**
     * 关联模型article
     */
    public function article()
    {
        return $this->hasMany(Article::class );
    }

    /**
     * 关联模型pushLog
     */
    public function pushLog()
    {
        return $this->hasMany(PushLog::class );
    }

    /**
     * 关联模型siteLink
     */
    public function siteLink()
    {
        return $this->hasMany(SiteLink::class );
    }

    /**
     * 关联模型member
     */
    public function member()
    {
        return $this->belongsTo(Member::class );
    }

    /**
     * 关联模型siteDemo
     */
    public function siteDemo()
    {
        return $this->belongsTo(SiteDemo::class );
    }
}
